import XRole from "../../XRole";

const { ccclass, property } = cc._decorator;

@ccclass
export default class ExampleItem extends cc.Component {


    @property(cc.Label)
    mName: cc.Label = null;
    mIndex = 0;

    updateItem(index) {
        if (index >= XRole.instance().mItemBaseMap.size) {
            this.node.active = false;
            return;
        }
        //根据ID获取对应物品并实例化
        this.mIndex = index;
        this.mName.string = "测试 " + index;
        this.node.active = true;
    };
}
